package com.cmas.manage.service;

import com.cmas.manage.domain.CApply;
import com.cmas.manage.domain.Community;
import com.cmas.manage.vo.CommunityVo;
import com.cmas.manage.bo.CommunityQueryBo;
import com.cmas.manage.bo.CommunityAddBo;
import com.cmas.manage.bo.CommunityEditBo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;
import java.util.List;

/**
 * 社团Service接口
 *
 * @author cmas
 * @date 2021-05-03
 */
public interface ICommunityService extends IService<Community> {
    /**
     * 查询单个
     * @return
     */
    CommunityVo queryById(Long id);

    /**
     * 查询列表
     */
    List<CommunityVo> queryList(CommunityQueryBo bo);

    /**
     * 根据新增业务对象插入社团
     *
     * @param bo 社团新增业务对象
     * @return
     */
    Boolean insertByAddBo(CommunityAddBo bo);

    /**
     * 根据编辑业务对象修改社团
     *
     * @param bo 社团编辑业务对象
     * @return
     */
    Boolean updateByEditBo(CommunityEditBo bo);

    /**
     * 校验并删除数据
     *
     * @param ids     主键集合
     * @param isValid 是否校验,true-删除前校验,false-不校验
     * @return
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     *  根据社长获取社团
     * @param userId
     * @return
     */
    List<Community> getCommunityByUser(Long userId);

    List<Community> listVo(Community community);

    int joinCommunity(CApply cApply);

    List<CApply> getWaitApprovalByUser(Long userId);

    int agreeJoinCmt(List<Long> asList);

    int refuseJoinCmt(List<Long> idList);

    List<CApply> getAgreeByUser(Long userId);

    List<CApply> getRefuseByUser(Long userId);
}
